local yunzhang = fk.CreateSkill{
    name = "lingling__yunzhang",
}
Fk:loadTranslationTable{
    ["lingling__yunzhang"] = "运掌",
    [":lingling__yunzhang"] = "回合开始时，你可以令一名其他角色交给你一张牌，则本回合你不能对其使用【杀】。",
    ["#lingling__yunzhang"] = "是否发动 运掌，令一名其他角色交给你一张牌，本回合你不能对其使用【杀】",
    ["#lingling__yunzhang-give"] = "运掌：交给 %dest 一张牌",
}
yunzhang:addEffect(fk.TurnStart,{
    can_trigger = function (self, event, target, player, data)
        return target == player and player:hasSkill(yunzhang.name)
    end,
    on_cost = function (self, event, target, player, data)
        local room = player.room
        local targets = table.filter(room:getOtherPlayers(player),function (cp)
            return not cp:isNude()
        end)
        if #targets > 0 then
            local tos = room:askToChoosePlayers(player,{
                targets = targets,
                skill_name = yunzhang.name,
                prompt = "#lingling__yunzhang",
                max_num = 1,
                min_num = 1,
            })
            if #tos > 0 then
                event:setCostData(self,{tos = tos})
                return true
            end
        end
    end,
    on_use = function (self, event, target, player, data)
        local room = player.room
        local to = event:getCostData(self).tos[1]
        local cards = room:askToCards(to,{
            max_num = 1,
            min_num = 1,
            include_equip = true,
            cancelable = false,
            skill_name = yunzhang.name,
            prompt = "#lingling__yunzhang-give::"..player.id
        })
        if #cards > 0 then
            room:obtainCard(player, cards, false, fk.ReasonGive, to, yunzhang.name)
        end
        room:addTableMark(player, "lingling__yunzhang-turn", to.id)
    end,
})

yunzhang:addEffect("prohibit", {
    is_prohibited = function(self, player, to, card)
        return card and card.trueName == "slash" and player and table.contains(player:getTableMark("lingling__yunzhang-turn"), to.id)
    end,
})

return yunzhang